CREATE EXTERNAL TABLE jms_dm.dm_oms_order_mark_detail_hi(
  order_id bigint COMMENT '订单id', 
  waybill_id string COMMENT '运单号', 
  label_str string COMMENT '标签', 
  order_source_code string COMMENT '订单来源编码', 
  order_source_name string COMMENT '订单来源名称', 
  input_time timestamp COMMENT '录入时间', 
  order_status_code string COMMENT '订单状态编码', 
  order_status_name string COMMENT '订单状态名称', 
  pick_network_code string COMMENT '取件网点编码', 
  pick_network_name string COMMENT '取件网点名称', 
  sender_province_id string COMMENT '寄件省份id', 
  sender_province string COMMENT '寄件省份', 
  sender_city_id string COMMENT '寄件城市id', 
  sender_city string COMMENT '寄件城市', 
  sender_area_id string COMMENT '寄件区域', 
  sender_area string COMMENT '寄件区域', 
  sender_detailed_address string COMMENT '寄件详细地址', 
  receiver_province_id string COMMENT '收件省份id', 
  receiver_province string COMMENT '收件省份', 
  receiver_city_id string COMMENT '收件城市id', 
  receiver_city string COMMENT '收件城市', 
  receiver_area_id string COMMENT '收件区域', 
  receiver_area string COMMENT '收件区域', 
  receiver_detailed_address string COMMENT '收件详细地址', 
  change_type int COMMENT '网点类型:1-订单状态或者取件网点改变,2-订单标签变化')
COMMENT '订单表打标'
PARTITIONED BY ( dt string COMMENT '时间分区')
stored as parquet
LOCATION '/dw/hive/jms_dm.db/external/dm_oms_order_mark_detail_hi'
TBLPROPERTIES ( 'discover.partitions' = 'false',  'parquet.column.index.access' = 'true');

alter table jms_dm.dm_oms_order_mark_detail_hi add colums
(
     customer_code string comment'客户编码'
     ,customer_name string comment'客户名称'
     ,pick_agent_code string comment'取件网点代理区code'
     ,pick_agent_name string comment'取件网点代理区name'
) CASCADE

